package com.ct.boot.launch.model.yaml;

import com.ct.boot.launch.service.MixPropertySourceFactory;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

/**
 * @Auther: Charles chen
 * @Date: 2020/7/3 12:26
 * @Description:
 */
@Data
@Component
@Validated
@PropertySource(value = "classpath:family.yml",factory = MixPropertySourceFactory.class)
@ConfigurationProperties(prefix = "family")
public class Family {
//    @Value("${family.father.name}")
    @NotEmpty
    private String familyName;

//    @Value("${family.father.age}")
    private Father father;
    private Mother mother;
    private Child child;
}
